package cmpe273.proj1;

import static org.junit.Assert.assertNotNull;

import javax.annotation.Resource;
import javax.jws.WebService;
import javax.xml.ws.WebServiceContext;

import cmpe273.proj1.dao.CourseDAO;
import cmpe273.proj1.dao.DAOFactory;
import cmpe273.proj1.dao.UserDAO;

/** ClassRecords WebService
 * WebService providing public interface for clients to connect and manage university records
 * @author Daniel Honegger
 * @version 1.0
 */
@WebService
public class ClassRecords {
	
	@Resource
    WebServiceContext context;
	
	private static DAOFactory factory = null;
	private static UserDAO userDAO = null;
	
	//Authentication
	public boolean login(String username, String password) {
		factory = DAOFactory.getInstance("school.jdbc");
		userDAO = factory.getUserDAO();
		userDAO.login(username, password);
		return true;
	}
	
	public boolean logout() {
		return true;
	}
 
	//Person calls
	public String insertPerson(String jsonStudentOrInstructor) {
		return "jsonObj";
	}
	
	public String changePerson(String jsonStudentOrInstructor) {
		return "jsonObj";
	}
	
	public String getPerson(String id) {
		return "jsonObj";
	}
	
	public boolean deletePerson(String id) {
		return true;
	}
	
	//Course calls
	public String insertCourse(String jsonCourse) {
		return "jsonObj";
	}
	
	public String changeCourse(String jsonCourse) {
		return "jsonObj";
	}
	
	public String getCourse(String courseId) {
		return "jsonObj";
	}
	
	public boolean deleteCourse(String courseId) {
		return true;
	}
	
	//Query
	public String getAllPeople(String type) {
		return "jsonArray";
	}
	
	public String searchPeople(String type, String jsonPersonOrStudentOrInstructor) {
		return "jsonArray";
	}
	
	public String getAllCourses() {
		return "jsonArray";
	}
	
	public String searchCourses(String jsonCourse) {
		return "jsonArray";
	}
	
	//Miscellaneous
	public double getTuition(String studentId) {
		return 0;
	}
}
